package com.firewolf.fr.s007_function;

import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import com.firewolf.fr.utils.FreeMarkerUtil;

import freemarker.template.Template;

public class Function {
	public static void main(String[] args) throws Exception {
		
		Map<String, String > data = new HashMap<String, String>();
		data.put("yl", "这是娱乐新闻");
		data.put("js", "这是军事新闻");
		data.put("zz", "这是政治新闻");
		data.put("sj", "这是世界新闻");
		
		Template tl = FreeMarkerUtil.getTemplate("007_function.ftl");
		Writer w = new OutputStreamWriter(System.out);// 把数据显示到控制台
		Map<String, Object> map = new HashMap<>();
		map.put("now", new Date());
		Date d = new Date();
		d.setMonth(12);
		map.put("now2", d);
		map.put("data", data);
		tl.process(map, w);
		w.flush();
		
		paraKB(1,2,3,5,6,67,6);
	}
	
	
	public static void paraKB(int ...num){
		int tatl = 0 ;
		for (int i: num){
			tatl += i;
		}
		System.out.println("paraKB:"+ tatl);
	}
	
}
